<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body style="padding:10px;">
<p>说明：
    <span>函数式的变量定义是否添加注释,表明意图</span>
</p>
<br/>
<p>正例：</p>
<div style="margin:10px;padding:10px;border:1px solid #000000;">
 <br/>   // 循环的流是passCertificationStream，所以函数式变量用的是passCertification
 <br/>   // 是否所有认证通过
 <br/>   final boolean isAllPassCertification = passCertificationStream.get().allMatch(passCertification -&gt; ILtgSiteConstant.ProgressStatus.PASS.equals(passCertification.getStatus()));
</div>
<br/>
<p>反例：</p>
<div style="margin:10px;padding:10px;border:1px solid #000000;white-space: pre-line;">
<br/>    // 集合是progresses但是函数式变量用的是i，增加阅读成本
<br/>    final boolean notPassCertification =
<br/>    progresses.stream().anyMatch(i -&gt; !ILtgSiteConstant.ProgressType.ASSESSMENT.equals(i.getProject())
<br/>    &amp;&amp; !ILtgSiteConstant.ProgressStatus.PASS.equals(i.getStatus()));
<br/>    if (!notPassCertification) {
<br/>        // ...
<br/>    }

</div>
</body>
</html>